exports.voteUserDetail = function (req, res) {

    var restfulParams = req.routeInfo.restfulParams;

    //最终结果
    var resultData = {};

    //任务流创建
    async.waterfall([

            //获取当前用户参与信息
            function (cb) {

                R.SEND_HTTP(
                    req,
                    {
                        url: CORE_APIConfig.coreAPI.searchVoteActivityUser + "/vau_id/" + restfulParams.u_id,
                        method: 'GET'
                    },
                    function (err, data) {
                        //判断是否有错误信息
                        if (err) {
                            return cb(err, data);
                        }

                        resultData.userData = data.data[0];

                        cb();
                    }
                );


            },
            //查询活动详细信息
            function (cb) {

                R.SEND_HTTP(
                    req,
                    {
                        url: CORE_APIConfig.coreAPI.searchOrganizationActivity + "/oa_id/" + restfulParams.oa_id,
                        method: 'GET'
                    },
                    function (err, data) {
                        //判断是否有错误信息
                        if (err) {
                            return cb(err, data);
                        }

                        resultData.organizationActivityData = data.data[0];

                        cb();
                    }
                );


            },
            //机构信息
            function(cb){

                R.SEND_HTTP(
                    req,
                    {
                        url: CORE_APIConfig.coreAPI.searchOrganization + "/o_id/" + resultData.organizationActivityData.oa_oid,
                        method: 'GET'
                    },
                    function (err, data) {
                        //判断是否有错误信息
                        if (err) {
                            return cb(err, data);
                        }

                        resultData.organizationData = data.data[0];

                        cb();
                    }
                );

            },
            //查询皮肤信息
            function (cb) {

                R.SEND_HTTP(
                    req,
                    {
                        url: CORE_APIConfig.coreAPI.searchActivitySkin + "/as_id/" + resultData.organizationActivityData.oa_skin_id,
                        method: 'GET',
                    },
                    function (err, data) {
                        //判断是否有错误信息
                        if (err) {
                            return cb(err, data);
                        }

                        var skin = data.data;
                        if(skin.length>0){
                            resultData.skinData = data.data[0];
                        }else{
                            resultData.skinData = [];
                        }
                        cb();
                    }
                );


            },

        ], function (err, result) {

            //返回最终拼接结果
            RES.response(res, true, resultData);

        }
    );

}